package com.abbas.smartCity.retroft

/**
 * Retrofit DSL 封装方法类
 * successThan 使得它不够优雅。
 * 但是想到重构，我就开始头疼
 */
class RetrofitCallbackDsl<T> {

    var onSuccess: ((T) -> Unit)? = null
    var onFailure: ((msg: String) -> Unit)? = null

    fun onSuccess(block: (T) -> Unit) {
        this.onSuccess = block
    }

    fun onFailure(block: (msg: String) -> Unit) {
        this.onFailure = block
    }

}